package com.matrix.media.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.PropertyNamingStrategy;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.aliyun.ice20201109.models.*;
import com.matrix.media.entity.Audio.AudioTrack;
import com.matrix.media.entity.TimeLine;
import com.matrix.media.entity.VideoTrack;
import javafx.animation.Timeline;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.apache.logging.log4j.util.Strings;
import org.springframework.util.DigestUtils;
import com.aliyun.ice20201109.Client;
import com.aliyun.teaopenapi.models.Config;

import java.sql.Time;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@Data
@AllArgsConstructor
public class AliIceUtil {

    private String endpoint;
    private String accessKeyId;
    private String accessKeySecret;
    private String bucketName;
    private String icePoint;


    public void getMediaProductingJob(String jobId) throws Exception {

        Config config = new Config();
        config.endpoint = icePoint;
        config.accessKeyId = accessKeyId;
        config.accessKeySecret = accessKeySecret;
        Client iceClient = new Client(config);

        GetMediaProducingJobRequest getMediaProducingJobRequest = new GetMediaProducingJobRequest();
        getMediaProducingJobRequest.setJobId(jobId);
        GetMediaProducingJobResponse getMediaProducingJobResponse = iceClient.getMediaProducingJob(getMediaProducingJobRequest);
        System.out.println("GetMediaProducingJobResponse : " + JSONObject.toJSONString(getMediaProducingJobResponse.body));
        String status = getMediaProducingJobResponse.getBody().getMediaProducingJob().getStatus();

        GetMediaProducingJobResponseBody.GetMediaProducingJobResponseBodyMediaProducingJob mediaProducingJob = getMediaProducingJobResponse.getBody().getMediaProducingJob();

        String timeline = mediaProducingJob.getTimeline();
        TimeLine timelineObj = JSON.parseObject(timeline, TimeLine.class);

        String mediaId = mediaProducingJob.getMediaId();

        String createTime = mediaProducingJob.getCreateTime();

        String projectId = mediaProducingJob.getProjectId();

        String status1 = mediaProducingJob.getStatus();

        String mediaURL1 = mediaProducingJob.getMediaURL();

        //timeline可以入库

        System.out.println(1111111);

    }

    /**
     * 主要功能
     * 设置一段文字，转为人声音频，再转成字幕合成到视频中，同时设置字体、字号等属性。
     * 进行任意数量的视频拼接。
     * 设置一段音频作为背景音乐。
     * 设置一个图片作为Logo水印。
     *
     * @throws Exception
     */
    public void batchProduceVideo() throws Exception {

        //文案素材
        String text = "测试文案aaaaa，装修了";

        //背景音乐
        String bgMusic = "https://my-matrix-media.oss-cn-beijing.aliyuncs.com/backgroundmusic.mp3?Expires=1697102765&OSSAccessKeyId=TMP.3KiNqkC65ZM3dxcH7Aj9HKK1rZp9sRt25HAtYESFto1iJEaeGUEhCeCQ8Koi6a7fHwZTdDe1uoog3wPaL3ymJveke764Sc&Signature=1opoFTxxH0wOwI6PLGouZsaUr5M%3D";

        //视频素材
        List<String> videoUrlList = new ArrayList<>();
        videoUrlList.add("https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/2d937050-0c98-40c6-ad90-6211ba85a86e.png");
        videoUrlList.add("https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/8b6b2fb6-22a8-4eb0-b0ca-61f32b29d002.png");
        videoUrlList.add("https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/53812322-9242-4dda-906d-9c06ba092d0a.png");

        //背景音乐
//        String bgMusic = "https://your-bucket.oss-cn-shanghai.aliyuncs.com/your-music.mp3";

        // 字幕样式设置
        Integer fontSize = 60;
        String fontName = "WenQuanYi Zen Hei Mono";
        String fontColor = "#FFFFFF";

        // 视频尺寸
        Integer width = 750;
        Integer height = 1334;

        // logo
        String logoUrl = "https://my-matrix-media.oss-cn-beijing.aliyuncs.com/00874a5e-0df2-446b-8f69-a30eb7d88ee8.png?Expires=1697102420&OSSAccessKeyId=TMP.3KiNqkC65ZM3dxcH7Aj9HKK1rZp9sRt25HAtYESFto1iJEaeGUEhCeCQ8Koi6a7fHwZTdDe1uoog3wPaL3ymJveke764Sc&Signature=OzvT6rVSaCJAy%2BPL2l6EuIfBEPw%3D";
        Integer logoX = 20;
        Integer logoY = 20;

        // 输出成片个数
        Integer outputCount = 1;

        // 每个成片包含视频片段数
        Integer videoCount = 3;

        for (int i = 0; i < outputCount; i++) {
            Collections.shuffle(videoUrlList);
            List<String> subUrls = videoUrlList.subList(0, videoCount);
//            produceSingleVideo(text, subUrls, bgMusic, fontSize, fontName, fontColor, logoUrl, logoX, logoY, width, height);

            produceSingleVideos(text, subUrls, bgMusic, fontSize, fontName, fontColor, logoUrl, logoX, logoY, width, height);
        }
    }

    // 提交单个任务
    public void produceSingleVideos(String text, List<String> videoUrls, String bgMusic, int fontSize, String fontName, String fontColor,
                                    String logoUrl, Integer logoX, Integer logoY, int width, int height) throws Exception {


        Config config = new Config();
        config.endpoint = icePoint;
        config.accessKeyId = accessKeyId;
        config.accessKeySecret = accessKeySecret;
        Client iceClient = new Client(config);

        TimeLine timelineObj = new TimeLine();

        // 组装视频轨
        VideoTrack videoTrack = new VideoTrack();
        videoTrack.handleVideoURLs(videoUrls);
        timelineObj.addVideoTrack(videoTrack);


        // 组装音频轨
        AudioTrack audioTrack = new AudioTrack();
        if (!Strings.isBlank(bgMusic)) {
            System.out.println("bgMusic不为空且不仅仅包含空格");
            audioTrack.addBgMusic(bgMusic);
            timelineObj.addAudioTrack(audioTrack);
        }

        AudioTrack voiceAudioTrack = new AudioTrack();
        // 组装字幕轨
        if (fontSize <= 0) {
            fontSize = 32;
        }
        if (Strings.isBlank(fontName)) {
            fontName = "WenQuanYi Zen Hei Mono";
        }
        if (Strings.isBlank(fontColor)) {
            fontColor = "#000000";
        }
        //添加人声
        voiceAudioTrack.addVoice(text, "sicheng", fontName, fontSize, fontColor);
        timelineObj.addAudioTrack(voiceAudioTrack);

        String timeline = JSON.toJSONString(timelineObj);
        System.out.println(timeline);


        // 提交合成任务
        SubmitMediaProducingJobRequest submitMediaProducingJobRequest = new SubmitMediaProducingJobRequest();
        submitMediaProducingJobRequest.setTimeline(timeline);

        String string = String.valueOf(Math.random());
        String videoName = DigestUtils.md5DigestAsHex(string.getBytes());

//        http://my-matrix-media.oss-cn-beijing.aliyuncs.com/
        String mediaURL = "https://" + bucketName + ".oss-cn-beijing" + ".aliyuncs.com/" + videoName + ".mp4";

        JSONObject mediaConfig = new JSONObject();
        mediaConfig.put("MediaURL", mediaURL);
        mediaConfig.put("Width", width);
        mediaConfig.put("Height", height);

//        submitMediaProducingJobRequest.setOutputMediaConfig("{\"MediaURL\":\"" + mediaURL + "\",\"Width\":" + width + ",\"Height\":" + height + "}");

        submitMediaProducingJobRequest.setOutputMediaConfig(mediaConfig.toJSONString());
        SubmitMediaProducingJobResponse submitMediaProducingJobResponse = iceClient.submitMediaProducingJob(submitMediaProducingJobRequest);
        System.out.println("job created, jobId : " + submitMediaProducingJobResponse.body.jobId + ", requestId : " + submitMediaProducingJobResponse.body.getRequestId() + ", mediaURL : " + mediaURL);


        // 等待合成任务完成
        while (true) {
            GetMediaProducingJobRequest getMediaProducingJobRequest = new GetMediaProducingJobRequest();
            getMediaProducingJobRequest.setJobId(submitMediaProducingJobResponse.body.jobId);
            GetMediaProducingJobResponse getMediaProducingJobResponse = iceClient.getMediaProducingJob(getMediaProducingJobRequest);
            System.out.println("GetMediaProducingJobResponse : " + JSONObject.toJSONString(getMediaProducingJobResponse.body));
            String status = getMediaProducingJobResponse.getBody().getMediaProducingJob().getStatus();
            if ("Success".equals(status) || "Failed".equals(status)) {
                break;
            }
            Thread.sleep(5000);
        }
    }

    // 提交单个任务
    public void produceSingleVideo(String text, List<String> videoUrls, String bgMusic, int fontSize, String fontName, String fontColor,
                                   String logoUrl, Integer logoX, Integer logoY, int width, int height) throws Exception {


        Config config = new Config();
        config.endpoint = icePoint;
        config.accessKeyId = accessKeyId;
        config.accessKeySecret = accessKeySecret;
        Client iceClient = new Client(config);


        // 组装字幕轨
        if (fontSize <= 0) {
            fontSize = 32;
        }
        if (Strings.isBlank(fontName)) {
            fontName = "WenQuanYi Zen Hei Mono";
        }
        if (Strings.isBlank(fontColor)) {
            fontColor = "#000000";
        }


        //        TimeLine timeLineDTO = new TimeLine();
//        VideoTrack videoTrack = new VideoTrack();
//        videoTrack.setType("111111");
//
//        List<VideoTrack> videoTracks = new ArrayList<>();
//        videoTracks.add(videoTrack);
//
//        timeLineDTO.setVideoTracks(videoTracks);
//        String string = JSON.toJSONString(timeLineDTO);


        // 组装视频轨
        JSONArray videoTrackClips = new JSONArray();

        JSONObject clip1 = new JSONObject();
        clip1.put("MediaURL", "https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/8b6b2fb6-22a8-4eb0-b0ca-61f32b29d002.png?Expires=1697135242&OSSAccessKeyId=STS.NTGyFu4qShvxsRR1x1nPXvz9e&Signature=49ZVqfm5NYYnqCG6CCByt4zt82M%3D&security-token=CAISjQJ1q6Ft5B2yfSjIr5fyMvzB2a5y37STcXTj1XhkYt90mb%2BShzz2IHhMdHVrCOoZt%2F41mGxX5%2FwTlrNyQJIAQEHIbMI1t8gMq17%2BPNWf4pPpt%2Bxf1cVg3YlX0UepsvXJasDVEfn%2FGJ70GX2m%2BwZ3xbzlD0bAO3WuLZyOj7N%2Bc90TRXPWRDFaBdBQVGAAwY1gQhm3D%2Fu2NQPwiWf9FVdhvhEG6Vly8qOi2MaRmHG85R%2FYsrZJ%2FN6sfcf7MZAzYM0vCIqPsbYoJvab4kl58ANX8ap6tqtA9Arcs8uVa1sruE3eY7aPo4cwdVUjOvRlSvQVtoTVkfxpp%2BryvKnbxhhEIOVJaSPbSZBJPQdeog1KXBqAAaHKf96I%2B1rsIwbrhtKVYtergwqlRvefr6MGp%2BqBbno04ByXzHAyh0Ro3KkWgWOuIrfzgoWr3O7UGJntt24KMPOwZeVTkBBbMCQen%2BGGzVGKUVj5BdOnaL9S6O4eluJ63rW9707GkrNCkCCtDJUoDI3YFvpWdUO%2B0Q89w0PCYlNXIAA%3D");
        clip1.put("Type", "Image");
//        videoTrackClips.add(clip1);
//
        JSONObject clip2 = new JSONObject();
        clip2.put("MediaURL", "https://my-matrix-media.oss-cn-beijing.aliyuncs.com/WechatIMG210.jpg?Expires=1697135242&OSSAccessKeyId=STS.NTGyFu4qShvxsRR1x1nPXvz9e&Signature=C%2FK%2FsjurqfmereWstI17%2BwdmQwE%3D&security-token=CAISjQJ1q6Ft5B2yfSjIr5fyMvzB2a5y37STcXTj1XhkYt90mb%2BShzz2IHhMdHVrCOoZt%2F41mGxX5%2FwTlrNyQJIAQEHIbMI1t8gMq17%2BPNWf4pPpt%2Bxf1cVg3YlX0UepsvXJasDVEfn%2FGJ70GX2m%2BwZ3xbzlD0bAO3WuLZyOj7N%2Bc90TRXPWRDFaBdBQVGAAwY1gQhm3D%2Fu2NQPwiWf9FVdhvhEG6Vly8qOi2MaRmHG85R%2FYsrZJ%2FN6sfcf7MZAzYM0vCIqPsbYoJvab4kl58ANX8ap6tqtA9Arcs8uVa1sruE3eY7aPo4cwdVUjOvRlSvQVtoTVkfxpp%2BryvKnbxhhEIOVJaSPbSZBJPQdeog1KXBqAAaHKf96I%2B1rsIwbrhtKVYtergwqlRvefr6MGp%2BqBbno04ByXzHAyh0Ro3KkWgWOuIrfzgoWr3O7UGJntt24KMPOwZeVTkBBbMCQen%2BGGzVGKUVj5BdOnaL9S6O4eluJ63rW9707GkrNCkCCtDJUoDI3YFvpWdUO%2B0Q89w0PCYlNXIAA%3D");
        clip2.put("Type", "Image");
        videoTrackClips.add(clip2);

        JSONObject clip3 = new JSONObject();
        clip3.put("MediaURL", "https://my-matrix-media.oss-cn-beijing.aliyuncs.com/WechatIMG209.jpg?Expires=1697135242&OSSAccessKeyId=STS.NTGyFu4qShvxsRR1x1nPXvz9e&Signature=ae4R%2Ft7ot4nIgBQZdp5CNCcmBnI%3D&security-token=CAISjQJ1q6Ft5B2yfSjIr5fyMvzB2a5y37STcXTj1XhkYt90mb%2BShzz2IHhMdHVrCOoZt%2F41mGxX5%2FwTlrNyQJIAQEHIbMI1t8gMq17%2BPNWf4pPpt%2Bxf1cVg3YlX0UepsvXJasDVEfn%2FGJ70GX2m%2BwZ3xbzlD0bAO3WuLZyOj7N%2Bc90TRXPWRDFaBdBQVGAAwY1gQhm3D%2Fu2NQPwiWf9FVdhvhEG6Vly8qOi2MaRmHG85R%2FYsrZJ%2FN6sfcf7MZAzYM0vCIqPsbYoJvab4kl58ANX8ap6tqtA9Arcs8uVa1sruE3eY7aPo4cwdVUjOvRlSvQVtoTVkfxpp%2BryvKnbxhhEIOVJaSPbSZBJPQdeog1KXBqAAaHKf96I%2B1rsIwbrhtKVYtergwqlRvefr6MGp%2BqBbno04ByXzHAyh0Ro3KkWgWOuIrfzgoWr3O7UGJntt24KMPOwZeVTkBBbMCQen%2BGGzVGKUVj5BdOnaL9S6O4eluJ63rW9707GkrNCkCCtDJUoDI3YFvpWdUO%2B0Q89w0PCYlNXIAA%3D");
        clip3.put("Type", "Image");
        videoTrackClips.add(clip3);

        JSONObject clip4 = new JSONObject();
        clip4.put("MediaURL", "https://my-matrix-media.oss-cn-beijing.aliyuncs.com/WechatIMG211.jpg?Expires=1697135242&OSSAccessKeyId=STS.NTGyFu4qShvxsRR1x1nPXvz9e&Signature=G2RctoU%2F3DcieJW2BWjhyEgqgek%3D&security-token=CAISjQJ1q6Ft5B2yfSjIr5fyMvzB2a5y37STcXTj1XhkYt90mb%2BShzz2IHhMdHVrCOoZt%2F41mGxX5%2FwTlrNyQJIAQEHIbMI1t8gMq17%2BPNWf4pPpt%2Bxf1cVg3YlX0UepsvXJasDVEfn%2FGJ70GX2m%2BwZ3xbzlD0bAO3WuLZyOj7N%2Bc90TRXPWRDFaBdBQVGAAwY1gQhm3D%2Fu2NQPwiWf9FVdhvhEG6Vly8qOi2MaRmHG85R%2FYsrZJ%2FN6sfcf7MZAzYM0vCIqPsbYoJvab4kl58ANX8ap6tqtA9Arcs8uVa1sruE3eY7aPo4cwdVUjOvRlSvQVtoTVkfxpp%2BryvKnbxhhEIOVJaSPbSZBJPQdeog1KXBqAAaHKf96I%2B1rsIwbrhtKVYtergwqlRvefr6MGp%2BqBbno04ByXzHAyh0Ro3KkWgWOuIrfzgoWr3O7UGJntt24KMPOwZeVTkBBbMCQen%2BGGzVGKUVj5BdOnaL9S6O4eluJ63rW9707GkrNCkCCtDJUoDI3YFvpWdUO%2B0Q89w0PCYlNXIAA%3D");
        clip4.put("Type", "Image");
        videoTrackClips.add(clip4);

        JSONObject clip5 = new JSONObject();
        clip5.put("MediaURL", "https://my-matrix-media.oss-cn-beijing.aliyuncs.com/abcdefg.mp4?Expires=1697135795&OSSAccessKeyId=STS.NTrNCbp7q9v5PFAmkCUYZE2BN&Signature=9lb%2FGbhVEGtm4uCw7aDL53O816Q%3D&security-token=CAISjQJ1q6Ft5B2yfSjIr5fHBfnWnehQjrTeUmDwiWsWWdZ2qvfprDz2IHhMdHVrCOoZt%2F41mGxX5%2FwTlrNyQJIAQEHIbMI1t8gMq17%2BPNWf4pPpt%2Bxf1cUnmYlX0UepsvXJasDVEfn%2FGJ70GX2m%2BwZ3xbzlD0bAO3WuLZyOj7N%2Bc90TRXPWRDFaBdBQVGAAwY1gQhm3D%2Fu2NQPwiWf9FVdhvhEG6Vly8qOi2MaRmHG85R%2FYsrZJ%2FN6sfcf7MZAzYM0vCIqPsbYoJvab4kl58ANX8ap6tqtA9Arcs8uVa1sruE3eY7aPo4cwdVUjOvRlSvQVtoTVkfxpp%2BryvKnbxhhEIOVJaSPbSZBJPQdeog1KXBqAAWWqutxpgoTL7HQtw65lVy4707kQs7EURw8sQt7lou9nC1lCAAOrBPFbXbLpixr0K8IgB%2Bl8rf312tTO5tmEUGwKUIeZGt89uCb7wOb41%2F05dMPTmgXEWQ3zF%2FCkOxL9FSj1yf68HkHy%2BhQZn%2BT2Lho2wiZmdr8BxKejp%2FiSkB60IAA%3D");
        videoTrackClips.add(clip5);

//        for (String url : videoUrls) {
//            JSONObject clip = new JSONObject();
//            clip.put("MediaURL", url);
//            if (url.contains(".jpg") || url.contains(".png")) {
//                clip.put("Type", "Image");
//            }
//            videoTrackClips.add(clip);
//        }

        // 组装音频轨
        String audioClip = "{\"AudioTrackClips\":[{\"Type\":\"AI_TTS\",\"Content\":\"" + text + "\",\"Voice\":\"sicheng\",\"Effects\":[{\"Type\":\"AI_ASR\",\"Font\":\"" + fontName + "\",\"Alignment\":\"BottomCenter\",\"Y\":0.1,\"FontSize\":" + fontSize + ",\"FontColor\":\"" + fontColor + "\",\"FontFace\":{\"Bold\":true,\"Italic\":false,\"Underline\":false}},{\"Type\":\"Volume\",\"Gain\":10}]}]}";
        String audioTracks;
        if (Strings.isBlank(bgMusic)) {
            audioTracks = "[" + audioClip + "]";
        } else {
            // 两个音频轨，一个人声，一个音乐
            audioTracks = "[" + audioClip + ",{\"AudioTrackClips\":[{\"MediaURL\":\"" + bgMusic + "\"}]}]";
        }

        // 贴图clips
        String logoClip = "";
        if (Strings.isNotBlank(logoUrl)) {
            logoClip = "{\"ImageURL\":\"" + logoUrl + "\",\"X\":" + logoX + ",\"Y\":" + logoY + "}";
        }

        // 拼时间线
        String timeline = "{\"VideoTracks\":[{\"VideoTrackClips\":" + videoTrackClips.toJSONString() + "}]," +
                "\"AudioTracks\":" + audioTracks + "}";
        System.out.println("timeline : " + timeline);

        // 提交合成任务
        SubmitMediaProducingJobRequest submitMediaProducingJobRequest = new SubmitMediaProducingJobRequest();
        submitMediaProducingJobRequest.setTimeline(timeline);

        String string = String.valueOf(Math.random());
        String videoName = DigestUtils.md5DigestAsHex(string.getBytes());

//        http://my-matrix-media.oss-cn-beijing.aliyuncs.com/
        String mediaURL = "https://" + bucketName + ".oss-cn-beijing" + ".aliyuncs.com/" + videoName + ".mp4";

        JSONObject mediaConfig = new JSONObject();
        mediaConfig.put("MediaURL", mediaURL);
        mediaConfig.put("Width", width);
        mediaConfig.put("Height", height);

//        submitMediaProducingJobRequest.setOutputMediaConfig("{\"MediaURL\":\"" + mediaURL + "\",\"Width\":" + width + ",\"Height\":" + height + "}");

        submitMediaProducingJobRequest.setOutputMediaConfig(mediaConfig.toJSONString());
        SubmitMediaProducingJobResponse submitMediaProducingJobResponse = iceClient.submitMediaProducingJob(submitMediaProducingJobRequest);
        System.out.println("job created, jobId : " + submitMediaProducingJobResponse.body.jobId + ", requestId : " + submitMediaProducingJobResponse.body.getRequestId() + ", mediaURL : " + mediaURL);


        // 等待合成任务完成
        while (true) {
            GetMediaProducingJobRequest getMediaProducingJobRequest = new GetMediaProducingJobRequest();
            getMediaProducingJobRequest.setJobId(submitMediaProducingJobResponse.body.jobId);
            GetMediaProducingJobResponse getMediaProducingJobResponse = iceClient.getMediaProducingJob(getMediaProducingJobRequest);
            System.out.println("GetMediaProducingJobResponse : " + JSONObject.toJSONString(getMediaProducingJobResponse.body));
            String status = getMediaProducingJobResponse.getBody().getMediaProducingJob().getStatus();
            if ("Success".equals(status) || "Failed".equals(status)) {
                break;
            }
            Thread.sleep(5000);
        }
    }



    /*
    job created, jobId : 9734dac3134e4cffad265c9fe3e50a07, requestId : 23EF2566-76AD-5145-B78F-AEB1F07C4431, mediaURL : https://my-matrix-media.oss-cn-beijing.aliyuncs.com/baa3303fb1dad341789411af5b015315.mp4
    GetMediaProducingJobResponse : {"mediaProducingJob":{"clipsParam":"null","completeTime":"1970-01-31T16:00:00Z","createTime":"2023-11-29T12:29:55Z","jobId":"9734dac3134e4cffad265c9fe3e50a07","mediaURL":"https://my-matrix-media.oss-cn-beijing.aliyuncs.com/baa3303fb1dad341789411af5b015315.mp4","modifiedTime":"2023-11-29T12:29:55Z","projectId":"dd929140eb31432790bf03c29e4e5661","status":"Init","timeline":"{\"VideoTracks\":[{\"VideoTrackClips\":[{\"MediaURL\":\"https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/8b6b2fb6-22a8-4eb0-b0ca-61f32b29d002.png\",\"Type\":\"Image\"},{\"MediaURL\":\"https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/2d937050-0c98-40c6-ad90-6211ba85a86e.png\",\"Type\":\"Image\"},{\"MediaURL\":\"https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/53812322-9242-4dda-906d-9c06ba092d0a.png\",\"Type\":\"Image\"}]}],\"AudioTracks\":[{\"AudioTrackClips\":[{\"MediaURL\":\"https://my-matrix-media.oss-cn-beijing.aliyuncs.com/backgroundmusic.mp3?Expires=1697102765&amp;OSSAccessKeyId=TMP.3KiNqkC65ZM3dxcH7Aj9HKK1rZp9sRt25HAtYESFto1iJEaeGUEhCeCQ8Koi6a7fHwZTdDe1uoog3wPaL3ymJveke764Sc&amp;Signature=1opoFTxxH0wOwI6PLGouZsaUr5M%3D\"}]},{\"AudioTrackClips\":[{\"Type\":\"AI_TTS\",\"Content\":\"测试文案aaaaa，装修了\",\"Effects\":[{\"Alignment\":\"BottomCenter\",\"FontFace\":{\"underline\":false,\"bold\":true},\"Type\":\"AI_ASR\",\"FontSize\":60,\"FontColor\":\"#FFFFFF\",\"Y\":0.1,\"Font\":\"WenQuanYi Zen Hei Mono\"},{\"Gain\":10.0}],\"Voice\":\"sicheng\"}]}]}"},"requestId":"8C300D96-A488-575A-BFD6-F3F2FBD8354E"}
    GetMediaProducingJobResponse : {"mediaProducingJob":{"clipsParam":"null","completeTime":"1970-01-31T16:00:00Z","createTime":"2023-11-29T12:29:55Z","jobId":"9734dac3134e4cffad265c9fe3e50a07","mediaId":"008db0808eb371ee9086f6e7d7696302","mediaURL":"https://my-matrix-media.oss-cn-beijing.aliyuncs.com/baa3303fb1dad341789411af5b015315.mp4","modifiedTime":"2023-11-29T12:29:56Z","projectId":"dd929140eb31432790bf03c29e4e5661","status":"Processing","timeline":"{\"VideoTracks\":[{\"VideoTrackClips\":[{\"MediaURL\":\"https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/8b6b2fb6-22a8-4eb0-b0ca-61f32b29d002.png\",\"Type\":\"Image\"},{\"MediaURL\":\"https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/2d937050-0c98-40c6-ad90-6211ba85a86e.png\",\"Type\":\"Image\"},{\"MediaURL\":\"https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/53812322-9242-4dda-906d-9c06ba092d0a.png\",\"Type\":\"Image\"}]}],\"AudioTracks\":[{\"AudioTrackClips\":[{\"MediaURL\":\"https://my-matrix-media.oss-cn-beijing.aliyuncs.com/backgroundmusic.mp3?Expires=1697102765&amp;OSSAccessKeyId=TMP.3KiNqkC65ZM3dxcH7Aj9HKK1rZp9sRt25HAtYESFto1iJEaeGUEhCeCQ8Koi6a7fHwZTdDe1uoog3wPaL3ymJveke764Sc&amp;Signature=1opoFTxxH0wOwI6PLGouZsaUr5M%3D\"}]},{\"AudioTrackClips\":[{\"Type\":\"AI_TTS\",\"Content\":\"测试文案aaaaa，装修了\",\"Effects\":[{\"Alignment\":\"BottomCenter\",\"FontFace\":{\"underline\":false,\"bold\":true},\"Type\":\"AI_ASR\",\"FontSize\":60,\"FontColor\":\"#FFFFFF\",\"Y\":0.1,\"Font\":\"WenQuanYi Zen Hei Mono\"},{\"Gain\":10.0}],\"Voice\":\"sicheng\"}]}]}"},"requestId":"986DB744-92E8-559F-97B9-5F19031F39DC"}
    GetMediaProducingJobResponse : {"mediaProducingJob":{"clipsParam":"null","code":"","completeTime":"2023-11-29T12:30:05Z","createTime":"2023-11-29T12:29:55Z","duration":12.0,"jobId":"9734dac3134e4cffad265c9fe3e50a07","mediaId":"008db0808eb371ee9086f6e7d7696302","mediaURL":"https://my-matrix-media.oss-cn-beijing.aliyuncs.com/baa3303fb1dad341789411af5b015315.mp4","message":"","modifiedTime":"2023-11-29T12:30:04Z","projectId":"dd929140eb31432790bf03c29e4e5661","status":"Success","timeline":"{\"VideoTracks\":[{\"VideoTrackClips\":[{\"MediaURL\":\"https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/8b6b2fb6-22a8-4eb0-b0ca-61f32b29d002.png\",\"Type\":\"Image\"},{\"MediaURL\":\"https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/2d937050-0c98-40c6-ad90-6211ba85a86e.png\",\"Type\":\"Image\"},{\"MediaURL\":\"https://my-sky-itcast-test.oss-cn-beijing.aliyuncs.com/53812322-9242-4dda-906d-9c06ba092d0a.png\",\"Type\":\"Image\"}]}],\"AudioTracks\":[{\"AudioTrackClips\":[{\"MediaURL\":\"https://my-matrix-media.oss-cn-beijing.aliyuncs.com/backgroundmusic.mp3?Expires=1697102765&amp;OSSAccessKeyId=TMP.3KiNqkC65ZM3dxcH7Aj9HKK1rZp9sRt25HAtYESFto1iJEaeGUEhCeCQ8Koi6a7fHwZTdDe1uoog3wPaL3ymJveke764Sc&amp;Signature=1opoFTxxH0wOwI6PLGouZsaUr5M%3D\"}]},{\"AudioTrackClips\":[{\"Type\":\"AI_TTS\",\"Content\":\"测试文案aaaaa，装修了\",\"Effects\":[{\"Alignment\":\"BottomCenter\",\"FontFace\":{\"underline\":false,\"bold\":true},\"Type\":\"AI_ASR\",\"FontSize\":60,\"FontColor\":\"#FFFFFF\",\"Y\":0.1,\"Font\":\"WenQuanYi Zen Hei Mono\"},{\"Gain\":10.0}],\"Voice\":\"sicheng\"}]}]}"},"requestId":"F700571A-FC6E-5FF2-AB6B-15215AC4F214"}
     */
}